Post

Replies

Boosts

Views

Activity

Is it possible to save a screenshot of a preview in Xcode 14?
The the enhancements to Xcode Previews in Xcode 14 are very helpful. I just had a situation where I wanted to take a screen capture of a preview of a view. Is there a built-in way to do that from Xcode, similar to taking a screen capture of the simulator screen? I realize I can just use a system-level screen capture, but then I have to adjust the size of what I capture to the area of the view in the preview. It would be great to just be able to have a button or shortcut and have the correct area captured.
3
2
2.8k
Jun ’22
Find songs by Beats Per Minute
Is it possible to search for songs by beats per minute? If so, how? The WWDC session mentioned a fitness app playing upbeat music to keep a user motivated during a workout. I'd like to let the user search for music at a certain tempo or range of tempos to find music appropriate for sections of a workout. Is this possible?
1
0
881
Jun ’21
Any SwiftUI SplitView 3-pane examples for macOS?
I am building a macOS app using SwiftUI. I've seen examples of using a NavigationView to do a Mail-style 3 pane app. In that case, there are two levels of master-detail so a NavigationView makes sense. (Mailboxes List > Messages List > Message Detail) I am trying to write a "Sidebar - Editor - Inspector" 3-pane app. In that case, the sidebar is the master, and both the editor and the inspector are part of a detail view of the selected item in the sidebar. So, it makes sense to use a split view between the editor and the inspector. Is there any sample code, tips, tricks, or anything at all demonstrating or describing how to get typical inspector behavior using HSplitView in a Mac app? The single sentence of documentation describes what a split view is, but no info on strategies for how to use it well. Thanks for any insights / anything at all really.
4
0
4.5k
Jul ’20
SwiftUI: Why use ReferenceFileDocument vs FileDocument?
I'm building a document-based app in SwiftUI. I see you can have a document that is a value type using FileDocument or a document that is a reference type using ReferenceFileDocument. There is no discussion in the documentation or in the WWDC session as to when you should use one instead of the other. From the WWDC session, it seems that FileDocument is the preferred approach. What are the use cases / conditions when it would make more sense to use a ReferenceFileDocument? What are the drawbacks of FileDocument that ReferenceFileDocument addresses? Thank you for any insights on this.
5
2
2.7k
Jul ’20